package com.yf.service.im;

import com.yf.entity.FriendEntity;
import com.yf.service.BaseService;
import com.yf.vo.FriendVo;

import java.util.List;


/**
 * 好友请求Service接口
 *
 * @author hxf
 * @email 505860922@qq.com
 * @date Wed Aug 29 17:47:08 CST 2018
 */
public interface FriendService extends BaseService<FriendEntity> {
    /**
    * @Description: 添加好友时查找好友，判断是否已经是好友
    * @author hyh
    * @Date 10:13 2018/9/10 0010
    * @Param
    * @return
    */
    FriendVo findUser(Long userId, String phone);


    /**
     * @Description: 查找好友
     * @author hyh
     * @Date 10:13 2018/9/10 0010
     * @Param
     * @return
     */
    List<FriendVo> findFriend(Long userId, String name);

    int addFriend(Long fromUserId,Long toUserId);

    //获取好友列表
    List<FriendVo> friendList(Long userId);

    //获取申请列表
    List<FriendVo> getApplyList(Long userId);

    //同意好友申请
    int agreeFriendApply(Long userId,Long friendId);

    //删除好友
    int deleteFriend(Long userId,Long friendId);

    //判断是否是好友
    boolean isFriend(Long userId,Long friendId);

    //判断是否加入了群聊
    boolean isGroupUser(Long userId,Long groupId);

}
